package mylooks.greenteam.Registration;

import mylooks.greenteam.R;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

public class FragmentGender extends Fragment implements View.OnClickListener
{
	ImageView img_male, img_female;
	Character gender = null;
	
	// onCreate
	@Override
	public void onCreate(Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
	}

	// onActivityCreated
	@Override
	public void onActivityCreated(Bundle savedInstanceState) 
	{
		super.onActivityCreated(savedInstanceState);
	}

	// onCreateView
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 
	{
		View layoutView = inflater.inflate(R.layout.registration_insert_gender, container, false);
		
		if(layoutView != null)
		{
			img_male = (ImageView)layoutView.findViewById(R.id.img_male);
			img_male.setOnClickListener(this);
			img_female = (ImageView)layoutView.findViewById(R.id.img_female);
			img_female.setOnClickListener(this);
		}
			
		return layoutView;
	}

	@Override
	public void onClick(View v) 
	{
		switch(v.getId())
		{
			case R.id.img_male : 
				gender = 'M';
				break;
				
			case R.id.img_female :
				gender = 'F';
				break;
		}
	}
	
	public Character GetGender()
	{
		return gender;
	}	
}
